//
//  BLCustomCenterViewController.m
//  blanket
//
//  Created by Mac on 2018/10/31.
//  Copyright © 2018 stoneobs@icloud.com. All rights reserved.
//

#import "BLCustomCenterViewController.h"
#import "BLClothShareViewController.h"
#import "BLApplyUnionViewController.h"
@interface BLCustomCenterViewController ()

@end

@implementation BLCustomCenterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"客服中心";
    [self configSubView];
    // Do any additional setup after loading the view.
}

#pragma mark --subView
- (void)configSubView{

    UIView * header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, 205)];
    header.backgroundColor = [UIColor whiteColor];

    
    
    STMenuControl * jiaruControl = [[STMenuControl alloc] initWithFrame:CGRectMake(0, 50, UIScreenWidth / 3, UIScreenWidth / 3) imageName:@"加入联盟"
                                                                    title:@"加入铺盖联盟" titleColor:BL_secendTextColor];
    [jiaruControl addTarget:self action:@selector(onSlectedJiaRu) forControlEvents:UIControlEventTouchUpInside];
    [header addSubview:jiaruControl];
    
    
    STMenuControl * huishouControl = [[STMenuControl alloc] initWithFrame:CGRectMake(UIScreenWidth / 3, 50, UIScreenWidth / 3, UIScreenWidth / 3) imageName:@"回收站"
                                                                  title:@"回收布草" titleColor:BL_secendTextColor];
    [huishouControl addTarget:self action:@selector(onSlectedHuiShou) forControlEvents:UIControlEventTouchUpInside];
    [header addSubview:huishouControl];
    
    STMenuControl * qqControl = [[STMenuControl alloc] initWithFrame:CGRectMake(2 * UIScreenWidth / 3, 50, UIScreenWidth / 3, UIScreenWidth / 3) imageName:@"客服"
                                                                    title:@"联系QQ客服" titleColor:BL_secendTextColor];
    [qqControl addTarget:self action:@selector(onSlectedLianxi) forControlEvents:UIControlEventTouchUpInside];
    [header addSubview:qqControl];
    
    self.tableView.tableHeaderView = header;

}
#pragma mark --Action Method
- (void)onSlectedJiaRu{
    [self.navigationController pushViewController:BLApplyUnionViewController.new animated:YES];
}
- (void)onSlectedHuiShou{
    [self.navigationController pushViewController:[BLClothShareViewController new] animated:YES];
}
- (void)onSlectedLianxi{
    NSString *qqNumber = @"2734173668";
    NSString *openQQUrl = [NSString stringWithFormat:@"mqq://im/chat?chat_type=wpa&uin=%@&version=1&src_type=web",qqNumber];
    NSURL *url = [NSURL URLWithString:openQQUrl];
    [[UIApplication sharedApplication] openURL:url];
}
@end
